package com.explorex.infra.puma.gateway.netty.im;


import com.explorex.infra.puma.gateway.netty.im.model.RpcCommonResponse;
import com.explorex.infra.puma.gateway.netty.ext.MessageEmitter;
import com.google.common.collect.Sets;

public class IMSendServiceImpl implements IMSendService{


    @Override
    public RpcCommonResponse senMessage(String senderId, Object msg) {

        Object respMsg=null;
        if(msg instanceof byte[]){
            String data=new String((byte[]) msg);

            respMsg= data;
        }

       MessageEmitter.emitMessage(senderId,"explorox"
               ,1,
               Sets.newHashSet(),
               respMsg,
               1,
               1,
               System.currentTimeMillis()
               );

        return new RpcCommonResponse(0,"","");
    }
}
